package com.maistars.spider.common.util;

import com.alibaba.fastjson.JSONObject;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;

/**
 * @author dhr
 * @date 2021/10/10 下午8:03
 */
public class JsonUtil {

    public static Map<String, String> JsonObjectToHashMap(JSONObject jsonObj) {
        Map<String, String> data = new HashMap<String, String>();
        Iterator it = jsonObj.keySet().iterator();
        while (it.hasNext()) {
            String key = String.valueOf(it.next().toString());
            String value = (String) jsonObj.get(key).toString();
            data.put(key, value);
        }
        return data;
    }


}
